<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/datepicker/datepicker3.css" />
    <script src="${request.contextPath}/statics/plugins/datepicker/bootstrap-datepicker.js"></script>
    <script src="${request.contextPath}/statics/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>

    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/fileinput.min.js"></script>
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/css/fileinput.css">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.title" @keyup.enter="query" placeholder="广告名称">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("news:openadvert:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("news:openadvert:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("news:openadvert:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default" align="center">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" style="width:90%!important;">
	            <div class="form-group">
	                <div class="col-sm-2 control-label" style="width: 10%;">广告名称</div>
	                <div class="col-sm-10" style="width: 40%;">
	                    <input type="text" class="form-control" width="80%" v-model="openAdvert.title" placeholder=""/>
	                </div>
                    <div class="col-sm-2 control-label" style="width: 10%;">时长(秒)</div>
                    <div class="col-sm-10" style="width: 40%;">
                        <input id="during" type="number" class="form-control" width="80%" v-model="openAdvert.during" placeholder=""/>
                    </div>
                </div>
	            <div class="form-group">
	                <div class="col-sm-2 control-label" style="width: 10%;">广告图片(1080*1620)</div>
	                <div class="col-sm-10" style="width: 40%;">
	                    <input type="file" id="myFile" name="myFile" class="form-control" width="80%" placeholder=""/>
	                </div>

                    <div class="col-sm-2 control-label" style="width: 10%;">跳转链接</div>
                    <div class="col-sm-10" style="width: 40%;">
                        <input type="text" class="form-control" width="80%" v-model="openAdvert.link" placeholder=""/>
                    </div>
                </div>
	            <div class="form-group">
	                <div class="col-sm-2 control-label" style="width: 10%;">开始时间</div>
	                <div class="col-sm-10" style="width: 40%;">
                        <input id="start_time" type="text" class="form-control" width="80%" v-model="openAdvert.startTime" placeholder="请选择开始时间" pattern="yyyy-MM-dd"/>
	                </div>
                    <div class="col-sm-2 control-label" style="width: 10%;">结束时间</div>
                    <div class="col-sm-10" style="width: 40%;">
                        <input id="end_time" type="text" class="form-control" width="80%" v-model="openAdvert.endTime" placeholder="请选择结束时间" pattern="yyyy-MM-dd"/>
                    </div>
                </div>

            <div class="form-group">
            	<div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/news/openadvert.js?_${.now?long}"></script>
</body>
</html>